export default function reducer(state, action) {
  // console.log(state)
  // console.log(action) // {type, payload}
  switch (action.type) {
    case 'increment':
      return { ...state, count: state.count + (action.payload ? action.payload : 1) }
    case 'decrement':
      return { ...state, count: state.count - 1 }
    default:
      return state;
  }
}